package ru.study.thinkin.chapter14;

import java.util.*;

public class Generators {
	
	public static <T> Collection<T> 
	fill(Collection<T> col,Generator<T> g,int j) {
		for (int i=0;i< j;i++ ) {
			col.add(g.next());
		}
		return col ;
	}
	
	public static void main(String[] args) {
		Collection<Coffee> c1 = new ArrayList<Coffee>();
		c1.add(new Americano());
		fill(c1,new CoffeeGenerator(),5);
		System.out.println(c1);
	}

}
